import { CHANGE_HOME_DATA } from "./constant";

// 正式的联调
import { getHomeData } from "@/services";

const changeHomeDataAction = (data) => ({
  type: CHANGE_HOME_DATA,
  data,
});

export const getHomeDataAction = () => {
  return (dispatch) => {
    getHomeData().then((res) => {
      dispatch(changeHomeDataAction(res.data.list));
    });
  };
};
